﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using zjxj_repair.Bean;
using zjxj_repair.Utils;

namespace zjxj_repair.WindowsForm.Modal
{
    public partial class RepairDataForm : Form
    {
        public RepairDataForm()
        {
            InitializeComponent();

            RepairDataGridView.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;

            RepairDataGridView.DataSource = StaticBean.RepairData;

            RepairDataGridView.Columns["VinCode"].HeaderText = RepairDataGridView.Columns["VinCode"].Name = "二维码";
            RepairDataGridView.Columns["PointName"].HeaderText = RepairDataGridView.Columns["PointName"].Name = "点位名称";
            RepairDataGridView.Columns["ToolName"].HeaderText = RepairDataGridView.Columns["ToolName"].Name = "工具名称";
            RepairDataGridView.Columns["Result"].HeaderText = RepairDataGridView.Columns["Result"].Name = "返修结果";
            RepairDataGridView.Columns["CreateTime"].HeaderText = RepairDataGridView.Columns["CreateTime"].Name = "返修时间";
            RepairDataGridView.Columns["ToolModel"].HeaderText = RepairDataGridView.Columns["ToolModel"].Name = "工具模式";

            RepairDataGridView.Columns["返修时间"].DefaultCellStyle.Format = "yyyy-MM-dd HH:mm:ss";

            //RepairDataGridView.Columns["工具名称"].ReadOnly = true;

            RepairDataGridView.Columns["Id"].Visible = false;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Close();
        }

        private void button1_Click_1(object sender, EventArgs e)
        {
            Tools.DicToExcel("repair", Tools.DataGirdViewToDic(RepairDataGridView));
        }
    }
}
